﻿using System.ComponentModel;
using System.Web.Script.Services;
using System.Web.Services;
using Module;
using Module.QuanTriHeThong.DanhMuc;

namespace HeThongSpa.Webservice.QuanTriHeThong.DanhMuc
{
    /// <summary>
    /// Summary description for wsPhanTramHoaHongDichVu
    /// </summary>
    [WebService(Namespace = "http://tempuri.org/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    [ToolboxItem(false)]
    // To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line. 
    [ScriptService]
    public class wsPhanTramHoaHongDichVu : WebService
    {
        private PhanTramHoaHongDichVu _phanTramHoaHongDichVu = new PhanTramHoaHongDichVu();

        [WebMethod(EnableSession = true)]
        public bool Insert(string madichvu, string machucvu, double phantramhoahongdichvu, string taikhoan)
        {
            _phanTramHoaHongDichVu = new PhanTramHoaHongDichVu
            {
                MaDichVu = madichvu.Trim(),
                MaChucVu = machucvu.Trim(),
                PhanTramHoaHong = phantramhoahongdichvu,
                TaiKhoan = taikhoan.Trim()
            };
            return _phanTramHoaHongDichVu.Insert(_phanTramHoaHongDichVu);
        }

        [WebMethod(EnableSession = true)]
        public bool DeleteByMaDichVu(string madichvu)
        {
            return _phanTramHoaHongDichVu.DeleteByMaDichVu(madichvu);
        }

        [WebMethod(EnableSession = true)]
        public string PhanTramHoaHongDichVu_SelectByMaDichVu(string madichvu)
        {
            return JsonMethods.ToJsonString(_phanTramHoaHongDichVu.PhanTramHoaHongDichVu_SelectByMaDichVu(madichvu));
        }
    }
}
